﻿using Learun.Application.TwoDevelopment.ZZDT_EC;
using Learun.Util;
using System.Collections.Generic;
using System.Data;
using System.Web.Mvc;

namespace Learun.Application.Web.Areas.ZZDT_EC.Controllers
{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-03-14 10:56
    /// 描 述：对象类型元件库
    /// </summary>
    public class ec_objecttypelibController : MvcControllerBase
    {
        private ec_objecttypelibIBLL ec_objecttypelibIBLL = new ec_objecttypelibBLL();

        #region 获取数据

        /// <summary>
        /// 获取对象类型元件库表数据
        /// <summary>
        /// <param name="objectTypeID">对象类型ID</param>
        /// <param name="ProjectId">项目ID</param>
        /// <returns></returns>
        [HttpGet]
        [AjaxOnly]
        public ActionResult GetObjectTypeLib(string objectTypeID, string ProjectId)
        {
            var data = ec_objecttypelibIBLL.GetObjectTypeLib(objectTypeID, ProjectId);
            return Success(data);
        }
        #endregion

        #region 提交数据

        /// <summary>
        /// 保存实体数据（新增、修改）
        /// <summary>
        /// <returns></returns>
        [HttpPost]
        [AjaxOnly]
        public ActionResult SaveObjectTypeLib(string objectTypeID, string strEntity, string ProjectId)
        {
            List<ec_objecttypelibEntity> entityList = strEntity.ToList<ec_objecttypelibEntity>();
            ec_objecttypelibIBLL.SaveObjectTypeLib(objectTypeID, entityList, ProjectId);
            return Success("保存成功！");
        }
        #endregion

    }
}
